
import { InitArguments } from "maishu-admin";
import { ImageService } from "maishu-services-sdk";

export const serviceHost = '127.0.0.1:2856'
let { protocol } = location;

export default function (args: InitArguments) {
    ImageService.baseUrl = `${protocol}//${serviceHost}/image`;

    args.app.setModulePath(":module/*", "admin/modules/:module/*");
    // args.app.setModulePath("station/*", "admin/modules/station/*");
    // args.app.setModulePath("product/*", "admin/modules/product/*");
    // args.app.setModulePath("product/*", "admin/modules/product/*");
    // args.app.setModulePath("components/*", "components/*");

    let lib = `lib`;
    requirejs.config({
        shim: {
            qrcode: {
                exports: 'QRCode'
            },
            'jquery-ui': {
                exports: 'window["$"]',
                deps: [
                    'jquery',
                    `css!${lib}/jquery-ui-1.10.0.custom`
                ]
            },

        },
        paths: {
            "clipboard": `${lib}/clipboard.min`,
            'qrcode': `${lib}/qrcode`,
            "jquery-ui": `${lib}/jquery-ui`,
            "jquery": `${lib}/jquery-2.1.3`,
            myWuZhui: `admin/myWuZhui`
        }
    })

}

